package ru.spies.pages;

import ru.spies.forms.LoginOrRegistrationForm;

public class ErrorPage extends AbstractPage{
	
	private static ErrorPage statThis;
	
	private static final String ERROR_MSG="<p>К сожалению, произошла ошибка! :((</p>";
	private static final String PAGE_NAME="Ошибочка :(";

	private ErrorPage() {
		
	}
	
	public static ErrorPage getInstance(){
		if (statThis==null){
			statThis = new ErrorPage();
		}
		return statThis;
	}
	
	@Override
	public String getThisPage(){
		/*
<!DOCTYPE html>
<html>
<head>
	<link href='http://fonts.googleapis.com/css?family=Lobster&subset=latin,cyrillic-ext' rel='stylesheet' type='text/css'>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="styles.css">
	<title>Имя страницы</title>
	<script src="spiesSite.js"> </script>
	<%
		ChooseContent.getInstance().readCookieAndSetNewChoose(request);
		switch (ChooseContent.getInstance().getCurrentContent()){
			case INDEX:
				ChooseContent.getInstance().chooseIndexContent();
				break;
			case NEWS:
				ChooseContent.getInstance().chooseNewsContent();
				break;
			case ABOUT:
				ChooseContent.getInstance().chooseAboutContent();
				break;
			case LAST_UPDATES:
				ChooseContent.getInstance().chooseLastUpdatesContent();
				break;
			case SITE_MAP:
				ChooseContent.getInstance().chooseSiteMapContent();
				break;
			case SYSTEM:
				ChooseContent.getInstance().chooseSystemContent();
				break;
			case LOGIN:
				ChooseContent.getInstance().chooseLoginContent();
				break;
			default:
				ChooseContent.getInstance().chooseDefault();
			break;
		}
	%>
</head>
<body class="background">
		<div class="header">
		</div>
		<div class="buttons">
			<button class="<%=CurrentButtonClass.getInstance().getButtonHomeClass() %>" onclick="goHome()">
				Главная 
			</button><button class="<%=CurrentButtonClass.getInstance().getButtonNewsClass() %>" onclick="goNews()">
				Новости
			</button><button class="<%=CurrentButtonClass.getInstance().getButtonSystemClass() %>" onclick="goSystem()">
				Система
			</button><button class="<%=CurrentButtonClass.getInstance().getButtonLoginClass() %>" onclick="goLogin()">
				Вход
			</button>
		</div>
		<div class="infoAndPanel" align="center">
			<div class="leftPanel">
				<div class="leftPanelTop">
				</div>
				<div class="leftPanelBody">
				 	<button class="<%=CurrentButtonClass.getInstance().getButtonAboutClass() %>" onclick="goAbout()">
				 		<span>О программе</span>
				 	</button>
				 	<button class="<%=CurrentButtonClass.getInstance().getButtonLastUpdatesClass() %>" onclick="goLastUpd()">
				 		<span>Последнии обновления</span>
				 	</button>
				 	<button class="<%=CurrentButtonClass.getInstance().getButtonSiteMapClass() %>" onclick="goMap()">
				 		<span>Карта сайта</span>
				 	</button>
				</div>
				<div class="leftPanelBot">
				</div>
				<div class="leftPanelTop">
				</div>
				<div class="leftPanelBody">
				 	<%=UserInfo.getInstance().getMyInfo() %>
				</div>
				<div class="leftPanelBot">
				</div>
			</div>	
			<div class="info">
				<div class="infoTop">
				</div>
				<div class="infoBody">
					<span class="contentInfo">				
						Контент
						<br>
					</span>				
				</div>
				<div class="infoBot">
				</div>
			</div>	
		</div>
		<div class="bot">
				"Secret group" © All rights reserved!
		</div>
</body>
</html>
		 */
		String msg = LoginOrRegistrationForm.getInstance().createFailureForm(ERROR_MSG);
		String pageName= PAGE_NAME;
		return getPage(pageName, msg,getStandartHeadContent());
	}

}
